<template>
    <div>
        <!-- 会员等级 ID={{id}} -->
        会员等级 ID={{this.$route.params.id}}
    </div>
</template>
<script>
export default {
    props: ['id'],
    name: "Memeberlevel",
    beforeRouteEnter:(to,from,next)=>{
        console.log("进入会员等级页面");
        next(vm =>{
            vm.getData();
        });
    },
    beforeRouteLeave:(to,from,next)=>{
        console.log("离开会员等级页面");
        next();
    },
    methods:{
        getData:function(){
            this.axios({
                method:'post',
                url:'/product/open/app/listProductsL1',
                headers: {
                   'Content-Type': 'application/json',
                   'x-token': 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ7XCJhcHBJZFwiOlwid3gwYWMzNTkyZjQ2NDcwM2NmXCIsXCJhcmVhSWRcIjo0LFwiY3VzdG9tZXJJZFwiOjQxNDgxMzU5OTM1NDg5LFwiY3VzdG9tZXJOYW1lXCI6XCLomZNeT15cIixcImdyb3VwTGVhZGVySWRcIjoyODEsXCJvcGVuSWRcIjpcIm9aaDYtNGdDTmx6Rzk5aFFmcFhyUGhmejdXbjBcIixcIm9wZXJhdG9ySWRcIjoxLFwic291cmNlXCI6MSxcInN0YXRpb25JZFwiOjEsXCJzdHJlZXRJZFwiOjQ1MTYsXCJzdXBwbGllcklkXCI6Mn0iLCJpc3MiOiJjZ3AiLCJ1c2VySWQiOjYxNDYsImlhdCI6MTYzNjM1NTk1OCwianRpIjoiQjU5QzhCQjAtODVCNC00QkNELThFMDMtNEVBMTM0QTRDMzQ1In0.bsqngrR0SXQ3CdtbAirslkGFKzTKx7aauyPP5BGwkyU'
                },
                data:{
                "pageNum": 1,
                "pageSize": 10
                }
            }).then((response) =>{          //这里使用了ES6的语法
                console.log(response)       //请求成功返回的数据
            }).catch((error) => {
                console.log("error")    
                console.log(error)    
            });
        }
    }
}
</script>
